/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package proveedores.webservice;

import com.sun.xml.internal.bind.v2.schemagen.xmlschema.List;
import java.util.Collection;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import proveedores.dao.ProveedorDAO;
import proveedores.excepcion.DAOExcepcion;
import proveedores.modelo.Proveedor;

/**
 *
 * @author GROSSEL
 */
@WebService(serviceName = "ProveedoresWS")
public class ProveedoresWS {
    /**
     * This is a sample web service operation
     */
    @WebMethod(operationName = "hello")
    public String hello(@WebParam(name = "name") String txt) {
        return "Hello " + txt + " !";
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "listar")
    public Collection<Proveedor> listar(@WebParam(name = "Result") Collection<Proveedor> Result) throws DAOExcepcion {
        //TODO write your implementation code here:
       ProveedorDAO dao = new ProveedorDAO();
       Collection<Proveedor> listar = dao.listar();
       Result = dao.listar();
    return Result;
    }
}
